<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    protected $table = "user";
    protected $guarded = [];

    public function getNicknameAttribute()
    {
        if (!is_null(json_decode($this->attributes['nickname']))) {
            return json_decode($this->attributes['nickname']);
        }else{
            return $this->attributes['nickname'];
        }
    }
}
